using System;
using UnityEngine.Serialization;

[System.Serializable]
public class MBattleDataConfig : BattleDataConfig
{
    public LevelArche[] levels ;
    public int killEnemyScore = 5;
    public int killWallScore = 10;

    public LevelArche GetLevel(int level)
    {
        if (levels != null)
        {
            return FindWithID(levels, level);
        }
        else
        {
            return null;
        }
    }

    T FindWithID<T>(T[] arr ,int id) where T:class
    {
        int index = id - 1;
        if (index < arr.Length)
        {
            return arr[index];
        }
        else
        {
            GameDebug.LogError($"id:{id}   arr length:{arr.Length}");
            return null;
        } 
    }
    
}


[System.Serializable]
public class LevelArche
{
    public int level;
    public int limitTime;

}